﻿
namespace BasicHostModule.Module
{
    public class MyHostedService : IHostedService
    {
        /// <summary>
        /// 应用程序运行的时候，调用
        /// </summary>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        /// <exception cref="NotImplementedException"></exception>
        public Task StartAsync(CancellationToken cancellationToken)
        {
            Console.WriteLine("项目启动加载......");
            return Task.CompletedTask;  
        }

        /// <summary>
        /// 应用程序停止的时候，调用
        /// </summary>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        /// <exception cref="NotImplementedException"></exception>
        public Task StopAsync(CancellationToken cancellationToken)
        {
            Console.WriteLine("项目关闭加载......");
            return Task.CompletedTask;
        }
    }
}
